package com.sls.game.dao.xinhe.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sls.game.dao.impl.SuperDAO;
import com.sls.game.dao.xinhe.XinHeGameDAO;
import com.sls.game.pojo.xinhe.XinHeGame;

@Repository("xinHeGameDAO")
public class XinHeGameDAOImpl extends SuperDAO<XinHeGame> implements
		XinHeGameDAO {

	@Override
	public void insert(XinHeGame game) {
		this.getSqlSession().insert("mybatis.xml.XinHeGameMapper.insert", game);
	}

	@Override
	public void update(XinHeGame game) {
		this.getSqlSession().update("mybatis.xml.XinHeGameMapper.update", game);
	}
	
	@Override
	public void update0(XinHeGame game) {
		this.getSqlSession().update("mybatis.xml.XinHeGameMapper.update0", game);
	}

	@Override
	public XinHeGame queryByAreaIdOrServerId(XinHeGame game) {
		XinHeGame ga = this.getSqlSession().selectOne(
				"mybatis.xml.XinHeGameMapper.queryByAreaIdOrServerId", game);
		return ga;
	}

	@Override
	public void delete() {
		this.getSqlSession().delete("mybatis.xml.XinHeGameMapper.delete");
	}

	@Override
	public List<XinHeGame> queryAllGame(String companyId) {
		List<XinHeGame> list = this.getSqlSession().selectList(
				"mybatis.xml.XinHeGameMapper.queryAllGame", companyId);
		return list;
	}

	@Override
	public List<XinHeGame> queryByAreaNameOrServerName(XinHeGame game) {
		List<XinHeGame> list = this
				.getSqlSession()
				.selectList(
						"mybatis.xml.XinHeGameMapper.queryByAreaNameOrServerName",
						game);
		return list;
	}

	@Override
	public List<XinHeGame> queryByCompanyId(String companyId) {
		List<XinHeGame> list = this
				.getSqlSession()
				.selectList(
						"mybatis.xml.XinHeGameMapper.queryByCompanyId",
						companyId);
		return list;
	}

	@Override
	public List<String> queryAreaNameByCompanyId(String companyId) {
		List<String> list = this
				.getSqlSession()
				.selectList(
						"mybatis.xml.XinHeGameMapper.queryAreaNameByCompanyId",
						companyId);
		return list;
	}

}
